# -*- coding: utf-8 -*-
# utils/rl_sms.py
from ronglian_sms_sdk import SmsSDK
from user.models import User


accId = '8a216da8747ac98201749c0de38723b7'
accToken = '86072b540b4648229b27400414150ef2'
appId = '8a216da8747ac98201749c0de45123be'


def send_message(phone, datas):
    user = User.objects.all()[0]
    print(user.username, '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%')
    sdk = SmsSDK(accId, accToken, appId)
    tid = '1'  # 测试模板id为: 1. 内容为: 【云通讯】您的验证码是{1}，请于{2}分钟内正确输入。
    # mobile = '13303479527'
    # datas = ('666777', '5')  # 模板中的参数按照位置传递
    # resp = sdk.sendMessage(tid, phone, datas)
    print("##########################################")
    print('执行了这个方法 send_message')
    return ''

from workorder.models import SubOrder



def test_crontab(x,y):
    need_approve = SubOrder.objects.filter(suborder_status='1')

    print('############### 执行test_crontab测试任务 #############')
    print('############### 邮件审批超时提醒 #############')

